<?php

namespace app\models;

use Yii;
use yii\base\Model;
class UpdatememberForm extends Model
{
  public $id;
  public $name;
  public $phone;
  public $realname;
  public $sfzid;
  public $bankcardid;
  public $opencardbank;
  public $alipay;

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['id','name','phone','realname', 'sfzid', 'bankcardid', 'opencardbank', 'alipay'], 'required'],
            [['name', 'realname', 'bankcardid', 'alipay'], 'string', 'max' => 30],
            [['opencardbank'], 'string', 'max' => 64],
            ['phone', 'match', 'pattern'=>'/^1[34578][0-9]{9}$/','message'=>'请输入正确的手机号'],
            //['sms', '\app\validators\SmscodeValidator', 'dowhat' => 'userRegister' ],管理员修改，无需短信验证码
            //['name', 'unique', 'targetClass' => '\app\models\Member', 'message' => '抱歉，已被注册，换一个吧.'],
            ['sfzid','match','pattern'=>'/(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/','message'=>'请输入正确的身份证号码'],
            //['bankcardid','match','pattern'=>'/^(998801|998802|622525|622526|435744|435745|483536|528020|526855|622156|622155|356869|531659|622157|627066|627067|627068|627069)\d{10}$/','message'=>'请输入正确的银行卡卡号（要求中国银行或中国农业银行或中国建设银行的银行卡卡号）'],
            ['bankcardid','match','pattern'=>
            '/^103\d{16}|'.
            '(623206|621671|620059|621282|621336|621619|622821|622822|622823|622824|622825|622826|622827|622828|622840|622841|622843|622844|622845|622846|622847|622848|622849|623018|620501'.
            '|621660|621661|621663|621667|621668|621666|456351|601382|621256|621212|621283|620061|621725|621330|621331|621332|621333|621297|621568|621569|623208|621620|621756|621757|621758'.
            '|621759|621785|621786|621787|621788|621789|621790|621672|621669|621662|623571|623572|623575|623263|623184|623569|623586|623573|621665|627025|627026|627027|627028|622771|622772'.
            '|622770|622273|622274'.
            '|621284|436742|589970|620060|621081|621467|621598|621621|621700|622280|622700|621673|623211|623668|623094|623669'.
            ')\d{13}|'.
            '(621293|621294|621342|621343|621364|621394|621648|621248|621215|621249|621231|621638|621334|621395'.
            '|421349|434061|434062|524094|526410|552245|621080|621466|621488|621499|622966|622988|621082|623251'.
            ')\d{10}|'.
            '(95595|95596|95597|95598|95599)\d{14}'.
            '$/',
            'message'=>'请输入正确的银行卡卡号'],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
          'id' => 'ID',
          'name' => '会员名称',
          'phone' => '手机号码',
          'realname' => '真实姓名',
          'sfzid' => '身份证号码',
          'bankcardid' => '银行卡号',
          'opencardbank' => '开户行',
          'alipay' => '支付宝账号',
        ];
    }
}
